package com.yb.guigu.pick.core.util;

import org.springframework.util.StringUtils;

import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;

/**
 * Copyright (C), 2022-2023, 姚兵
 * Author: 32210
 * Date: 2023/6/8 12:50
 * FileName: StringUtil
 * Description:
 */
public class StringUtil {


    public static String join(String...  arr){
        return   Arrays.stream(arr).filter(StringUtils::hasText).collect(Collectors.joining(","));
    }


    public static String join(List<String> list){
        return list.stream().filter(StringUtils::hasText).collect(Collectors.joining(","));
    }


    public static String join(Object... arr){
        return Arrays.stream(arr).map(String::valueOf).filter(StringUtils::hasText).collect(Collectors.joining(","));
    }

}
